<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/hdocs/style/css/center.css" type="text/css" rel="stylesheet" />
<link href="/hdocs/style/css/common.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/hdocs/jquery/js/jquery-1.8.2.js"></script>
<title>瓜朋网-消息中心私信</title>
</head>
<body>
      #set ($menuIndex="darren") #parse("/inc/header.html")
      <p class="h10"></p>
      <p class="h10"></p>
      <div class="centent">
            <div class="messLe">
                 <p class="messTcT">消息中心</p>
                 <a href="/message/notifys.jsp" class="def">写信</a>
                 <a href="/message/lettersInbox.jsp">站内信</a>
                 <a href="/message/notifys.jsp">通知</a>
            </div>
            <div class="cenRi">
            	<form id="mainFrom" action="/message/write.jsp" method="post">
	                  <p class="dataLtit">发站内信</p>
	                  <div class="dataTex">
	                        <p class="dataInpt">
	                        	<span style="width:60px;">收件人：</span>
	                        	<input id="username" type="text" onfocus="setText()" name="username" value="输入对方昵称" class="dning"/>
	                        </p>
	                        <p class="h10"></p>
	                        <span class="c9c9c9">0/300个字</span>
	                        <p class="datxx">
	                            <span style="width:60px;">内容：</span>
	                            <textarea id="message" name="message" class="dataTrv"></textarea>
	                        </p>
	                        <p class="BtnSm"><a href="javascript:sendMsg();">发送</a></p>
	                  </div>
	            </form>
                <p class="h10"></p>
                <p class="h10"></p>
                <p class="h10"></p>
                <p class="h10"></p>
                <p class="h10"></p>
            </div>
      </div>
      #parse("/inc/footer.html")
</body>
</html>
<script type="text/javascript">
function setText(){
	var username = $("#username").val();
	if(username=="输入对方昵称"){
		$("#username").val("");
	}
}

function sendMsg() {
	if(!validate()){
		return;
	}
	if(!confirm("您确认发布消息吗?")){
		 return;
	}
	$("#mainFrom").submit();
}

function validate(){
	var username = $("#username").val();
	if(username==null||username==''){
		alert("收件人不能为空！");
		return false;
	}
	var message = $("#message").val();
	if(message==null||message==''){
		alert("内容不能为空！");
		return false;
	}
	return true;
}
</script>

